-
Notifications
You must be signed in to change notification settings - Fork 29
DOCSP-45330: inheritance #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSP-45330: inheritance #66
Conversation
✅ Deploy Preview for docs-mongoid ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work ✨ LGTM with a few grammar nits and suggestions.
source/data-modeling/inheritance.txt
Outdated
~~~~~~~~~~~~~~ | ||
|
||
When you query on a child model class, the query returns only documents | ||
in which the value of the ``_type`` field match the queried class or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which the value of the ``_type`` field match the queried class or | |
in which the value of the ``_type`` field matches the queried class or |
source/data-modeling/inheritance.txt
Outdated
.. note:: | ||
|
||
Because the discriminator value customization is declared in child classes, | ||
you must load the child classes retrieved by a query *before* sending | ||
that query. In the preceding example, the ``Employee`` class definition | ||
must be loaded before you query on ``Person`` if the returned documents could | ||
potentially be instances of ``Employee``. Autoloading isn't able to resolve | ||
the discriminator value ``"Worker"`` to return the document as an | ||
instance of ``Employee``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[s] Can potentially omit extra words for brevity and make this note easier to follow, for example:
.. note:: | |
Because the discriminator value customization is declared in child classes, | |
you must load the child classes retrieved by a query *before* sending | |
that query. In the preceding example, the ``Employee`` class definition | |
must be loaded before you query on ``Person`` if the returned documents could | |
potentially be instances of ``Employee``. Autoloading isn't able to resolve | |
the discriminator value ``"Worker"`` to return the document as an | |
instance of ``Employee``. | |
.. note:: | |
Because the discriminator value customization is declared in child classes, | |
you must load the child classes retrieved by a query *before* sending | |
that query. In the preceding example, the ``Employee`` class definition | |
must be loaded before you query on ``Person`` if the returned documents could | |
be instances of ``Employee``. Autoloading cannot resolve | |
the discriminator value ``"Worker"`` to return the document as an | |
instance of ``Employee``. |
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-45330
Staging - https://deploy-preview-66--docs-mongoid.netlify.app/data-modeling/inheritance/
Self-Review Checklist